package TestModel;

import MainModel.CLIManager;
import junit.framework.TestCase;

public class CompleteTest extends TestCase 
{
	/***************************************************/
	/****** Members ************************************/
	/***************************************************/
	private CLIManager m_cliManager = new CLIManager();
	
	
	/***************************************************/
	/****** C'tor ************************************/
	/***************************************************/
	public CompleteTest() 
	{
		m_cliManager.SetLayout("execution/EvgeniTest1.cif");
	}
	
	
	/***************************************************/
	/****** Tests ************************************/
	/***************************************************/
	public void testMANCommand() 
	{
		PrintStartTest("MAN");
		m_cliManager.DebugShell("man");
		PrintEndTest();
	}
	
	public void testDRCCommand() 
	{
		PrintStartTest("DRC");
		m_cliManager.DebugShell("drc execution/DesignRules.txt");
		PrintEndTest();
	}
	
	public void testBDCommand() 
	{
		PrintStartTest("BD");
		m_cliManager.DebugShell("bd 0 0 , 1 1 ; 2 2 , 4 4");
		PrintEndTest();
	}

	public void testSPACECommand() 
	{
		PrintStartTest("SPACE");
		m_cliManager.DebugShell("space 0 0 , 1 1");
		PrintEndTest();
	}
	
	public void testPERIMCommand() 
	{
		PrintStartTest("PERIM");
		m_cliManager.DebugShell("perim 0 0 , 1 1");
		PrintEndTest();
	}
	
	public void testUNIONCommand() 
	{
		PrintStartTest("UNION");
		m_cliManager.DebugShell("union 0 0 , 1 1 ; 2 2 , 4 4");
		PrintEndTest();
	}
	
	public void testNEIGHBCommand() 
	{
		PrintStartTest("NEIGHB");
		m_cliManager.DebugShell("neighb 0 0 , 1 1");
		PrintEndTest();
	}
	
	public void testCROSSCAPCommand() 
	{
		PrintStartTest("CROSSCAP");
		m_cliManager.DebugShell("crosscap 3 ; 5");
		PrintEndTest();
	}
	
	public void testPLACECommand() 
	{
		PrintStartTest("PLACE");
		m_cliManager.DebugShell("place 0 0 , 1 1 ; 0 0 , 2 2 ; 3");
		PrintEndTest();
	}
	
	public void testWHITECommand() 
	{
		PrintStartTest("WHITE");
		m_cliManager.DebugShell("white 0 0 , 10 10 ; 5 ; x");
		
		m_cliManager.DebugShell("white 0 0 , 10 10 ; 5 ; y");
		
		m_cliManager.DebugShell("white 0 0 , 10 10 ; 5 ; all");
		PrintEndTest();
	}
	
	public void testCONNECTCommand() 
	{
		PrintStartTest("CONNECT");
		m_cliManager.DebugShell("connect 0 0 , 1 1 ; 2 ; 0 0 , 2 2 ; 3");
		m_cliManager.DebugShell("connect 0 0 , 2 2 ; 3 ; 0 0 , 2 2 ; 3");
		PrintEndTest();
	}
	
	
	/***************************************************/
	/****** Utils ************************************/
	/***************************************************/
	private void PrintStartTest(String str)
	{
		System.out.println("**************************************");
		System.out.println("**** " + str);
	}
	
	private void PrintEndTest()
	{		
		System.out.println("**************************************");
	}
}
